package com.cpp.pojo.pojo;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.tool.annotation.ToolParam;

import java.time.LocalDateTime;

//id INT PRIMARY KEY AUTO_INCREMENT COMMENT '考试id',
//course_id INT COMMENT '考试所属课程的id',
//user_id INT COMMENT '创建考试的用户id',
//exam_title VARCHAR(255) COMMENT '考试的标题',
//exam_detail TEXT COMMENT '考试的详细说明',
//status INT COMMENT '考试状态：1`未开始`/2`进行中`/3`已结束`',
//attempt_limit  int      default 1                 not null comment '考试次数限制(0表示不限次数)',
//type1_count    int      default 5                 not null comment '题型1数量(开放题)',
//type2_count    int      default 5                 not null comment '题型2数量(简答题)',
//type3_count    int      default 5                 not null comment '题型3数量(单选题)',
//type4_count    int      default 5                 not null comment '题型4数量(多选题)',
//question_count int as ((`type1_count` + `type2_count`+ `type3_count`+ `type4_count`)) stored comment '总题数',
//start_time DATETIME COMMENT '考试开始时间',
//end_time DATETIME COMMENT '考试结束时间',
//total_time INT COMMENT '考试时长(分钟)',
//created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
//updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Exam {
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    private Long courseId;
    private Long userId;
    private String examTitle;
    private String examDetail;
    private Integer status;
    private Integer attemptLimit;
    private Integer type1Count;//开
    private Integer type2Count;//简
    private Integer type3Count;//单
    private Integer type4Count;//多
    private String summary;
    //questionCount仅查询
    @TableField(
            insertStrategy = FieldStrategy.NEVER,
            updateStrategy = FieldStrategy.NEVER
    )
    private Integer questionCount;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    //考试时长（分钟）
    private Integer totalTime;
}
